package org.iabako.shared.iservice.business;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import org.iabako.shared.entity.business.ClientConversation;
import org.iabako.shared.iservice.generic.CRUDServiceAsync;
import org.iabako.shared.iservice.generic.SearchServiceAsync;

import java.io.Serializable;

/**
 * Created by jose on 12/02/15.
 */
public interface ClientConversationServiceAsync extends SearchServiceAsync, CRUDServiceAsync {

    void save(ClientConversation clientConversation, AsyncCallback<ClientConversation> async);

    void addConversationFromEmail(Long idClient, String email, Serializable iabakoMailHelper, AsyncCallback<Void> async);

    public static final class Util {
        private static ClientConversationServiceAsync instance;

        public static final ClientConversationServiceAsync getInstance() {
            if (instance == null) {
                instance = GWT.create(ClientConversationService.class);
            }
            return instance;
        }
    }
}
